<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>onblur</title>
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="../../jsfile/layer.css"/>
    <script src="../../jsfile/jquery.js"></script>
    <script src="../../jsfile/layer.js"></script>
    <script src="../../jsfile/base.js"></script>

    <script type="text/javascript">
        //静态注册失去焦点事件
        function onblurFun(){
            //console是控制台对象,是由javascript语言提供,专门用来向浏览器打印输出,用于测试使用
            //log() 是打印的方法
            console.log("静态失去焦点事件");
        }

        //动态注册onblur事件
        window.onload = function (){
            //1.获取标签对象
            var passwordObj = document.getElementById("password");
            //2.通过标签对象.事件名 = function(){}
            passwordObj.onblur = function(){
                console.log("动态注册失去焦点事件");
            }
        }

    </script>


</head>
<body>
<p id="text_show">
onblur
</p>


<div class="look_source_code" onclick="getPageContent()">查看源码</div>
用户名:<input type="text" onblur="onblurFun()"><br/>
密&nbsp; &nbsp;码:<input type="password" id="password">
</body>


</html>


